perm filename DEMO.MF[MF,DEK]1 blob sn#750650 filedate 1984-04-13 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00006 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	delimiters ()
C00003 00003	pausing:=1
C00004 00004	h:=3 v:=2
C00005 00005	def demochar(expr h,v)=
C00006 00006	tracingedges:=1
C00007 ENDMK
CāŠ—;
delimiters ();
def tracingall=tracingcommands:=3;
 tracingedges:=1; tracingtitles:=1; tracingequations:=1; tracingspecs:=2;
	tracingpens:=1; tracingchoices:=1; tracingstats:=2;
 tracingonline:=1;tracingoutput:=1;tracingmacros:=3 enddef;
%tracingall;

vardef z@#=(x@#,y@#) enddef;

edges e;
e=nulledges;

def draw expr x = addto e contour x withweight 1 enddef;
def erase expr x = addto e contour x withweight -1 enddef;

openwindow 1 from (0,0) to (400,450) at (-100,200);

smoothing:=1; autorounding:=3;

hppp:=240/72.27;
vppp:=hppp;
charcode:=96;

tracingedges:=1; tracingonline:=1;
pausing:=1;
h=1; v=1;

z1=(6h,0);
z2=(0,8v);
z3=(4h,11v);
z4=(10h,8v);
z5=(17h,9v);
z6=(18h,2v);

draw z1..z2..z3..z4..z5..z6..cycle
 ;
display e on 1;
shipout e;

e:=nulledges; numeric x[],y[]; % get ready for next demo
h:=3; v:=2;

z1=(6h,0);
z2=(0,8v);
z3=(4h,11v);
z4=(10h,8v);
z5=(17h,9v);
z6=(18h,2v);

z0=(9h,3v);

show z0,z1;
show z1+(1,1);
show z6-z5;


z1a-z0=2(z1-z0);
z2a-z0=2(z2-z0);
z3a-z0=2(z3-z0);
z4a-z0=2(z4-z0);
z5a-z0=2(z5-z0);
z6a-z0=2(z6-z0);

show z1a;

draw z1a..z2a..z3a..z4a..z5a..z6a..cycle;
erase z1..z2..z3..z4..z5..z6..cycle;

display e on 1;
def demochar(expr h,v)=
e:=nulledges;
numeric x[],y[],x[]a,y[]a;
charcode:=charcode+1;

z1=(6h,0);
z2=(0,8v);
z3=(4h,11v);
z4=(10h,8v);
z5=(17h,9v);
z6=(18h,2v);

z0=(9h,3v);

for n:=1 step 1 until 6:
 z[n]a-z0 = 2(z[n]-z0);
endfor

draw z1a..z2a..z3a..z4a..z5a..z6a..cycle;
erase z1..z2..z3..z4..z5..z6..cycle;

display e on 1;

charwd:=40h/hppp;
chardw:=40h;
shipout e;

enddef;
tracingedges:=1;
demochar(1,1);
tracingedges:=0;
demochar(2,1);
demochar(1,2);
demochar(10,10);
demochar(10,-10);
end